Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed paste error in rarefy_even_dept & improved efficiency #1630

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

salix-d
Copy link

@salix-d salix-d commented Oct 23, 2022

Wanted to fix the message outputting the names of the samples pruned since there was no space between them.

Also made some changes to improve speed and memory usage, mainly :
unlist(data.frame()) --> rep.int() and table() --> tabulate().
I added comment in the code for those changes.
Also, merged some message functions and used @ when possible.
I tested everything and it all passed; I updated the depricated functions in the tests as well.

With my data (33323 taxa and 384 samples), it's uses half the memory and runs ~28x faster with replace = FALSE which makes it as fast and memory efficient as with replace = TRUE.

edit: I also changed the check for rngseed because it wouldn't let me use 0.

fixed the paste mistake in the message for removed samples (there were no space between the names)
changed `unlist(data.frame())` for `rep.int()`; faster, uses less memory
merge `message` functions
added comment for the changes
used `@` when possible
replaced `badcolumns`with -(1:CN); more straightforward
tested everything; all passed
had lots of warnings about `is_true` and `is_false` being deprecated so I changed the syntax for `expect_true` and `expect_false`
merge message to match other messages
@salix-d
Copy link
Author

salix-d commented Oct 23, 2022

I did not update the doc of the replace argument though.

the way I modified it `FALSE wasn't allowed anymore, so fixed that
@salix-d salix-d changed the title Fixed paste error in rarefy_even_dept & improved efficiencyFix rarefy Fixed paste error in rarefy_even_dept & improved efficiency Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant